home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / olaptble / _setup.1 / ACODemo4.vbs < prev    next >
Encoding:
Text File  |  1998-03-20  |  3.2 KB  |  90 lines

  1. ' Demo Script ACODemo4.Vbs
  2. '
  3. ' Alpha Centauri - March 1998
  4. ' ---------------------------
  5.  
  6. Dim etFlat    ' EdgeType Constant
  7. Dim tsSpace    ' ThousandsSep Constant
  8. Dim lbShort    ' Label Constant
  9. Dim trHigh    ' Threshold Constant
  10. Dim trMiddle    ' Threshold Constant
  11. Dim trLow    ' Threshold Constant
  12.  
  13. ' Set Constants
  14. etRaised = 0
  15. tsSpace  = 0
  16. lbShort  = 0
  17. trHigh   = 0
  18. trMiddle = 1
  19. trLow    = 2
  20.  
  21. ' Connect to Personal Express and open the ACODemo Database
  22. Call ACOTable.Connect(False)
  23. Call ACOTable.Open("C:\PROGRA~1\ACOTABLE\ACODEMO", True)
  24.  
  25. ACOTable.AutoRefresh = FALSE
  26.  
  27. ' Remove previously selected Measures
  28. Call ACOTable.RemoveAllMeasures()
  29.  
  30. ' Set General Measure Properties
  31. ACOTable.Decimals          = 0
  32. ACOTable.ThousandsSep      = tsSpace
  33. ACOTable.EdgeTypeDown      = etFlat
  34. ACOTable.FontColor         = 255*256*256 + 0 + 0
  35. ACOTable.DownEdgeFillColor = 234*256*256 + 219*256 + 160
  36.  
  37. ' Add the following measures to the table 
  38. Call ACOTable.AddCustomMeasure("UNITSLY", "Lag(UNITS, 12, TIME)","ACODEMO")
  39. Call ACOTable.AddMeasure("UNITS")
  40. Call ACOTable.AddCustomMeasure("UNITSLYPCT", "LagPct(UNITS, 12, TIME)*100","ACODEMO")
  41.  
  42. ' Set Labels for the measures
  43. Call ACOTable.SetMeasLabel("UNITS", lbShort, "Units")
  44. Call ACOTable.SetMeasLabel("UNITSLY", lbShort, "Units LY")
  45. Call ACOTable.SetMeasLabel("UNITSLYPCT", lbShort, "Units vs LY %")
  46.  
  47. ' Set specific properties for the measure UNITSLY
  48. Call ACOTable.SetMeasUseDisplayFormat("UNITSLY", TRUE)
  49. Call ACOTable.SetMeasFillColor("UNITSLY", 195*256*256 + 195*256 + 228)
  50.  
  51. ' Set specific properties for the measure UNITS
  52. Call ACOTable.SetMeasUseDisplayFormat("UNITS", TRUE)
  53. Call ACOTable.SetMeasFillColor("UNITS", 193*256*256 + 228*256 + 193)
  54.  
  55. ' Set specific properties for the measure UNITSLYPCT
  56. Call ACOTable.SetMeasUseDisplayFormat("UNITSLYPCT", TRUE)
  57. Call ACOTable.SetMeasUseMeasureFormat("UNITSLYPCT", TRUE)
  58. Call ACOTable.SetMeasSuffix("UNITSLYPCT", " %")
  59. Call ACOTable.SetMeasDecimals("UNITSLYPCT",2)
  60.  
  61. ' Set ThresholdCoding Properties for UNITSLYPCT
  62. Call ACOTable.SetMeasUseThresholdCoding("UNITSLYPCT", TRUE)
  63. Call ACOTable.SetMeasThreshold("UNITSLYPCT",trHigh, 5)
  64. Call ACOTable.SetMeasThreshold("UNITSLYPCT",trLow, -5)
  65. Call ACOTable.SetMeasThresholdFillColor("UNITSLYPCT", trHigh, 0 + 255*256 + 0)
  66. Call ACOTable.SetMeasThresholdFillColor("UNITSLYPCT", trMiddle, 222*256*256 + 222*256 + 222)
  67. Call ACOTable.SetMeasThresholdFillColor("UNITSLYPCT", trLow, 0 + 0 + 255)
  68. Call ACOTable.SetMeasThresholdFontColor("UNITSLYPCT", trHigh, 0 + 0 + 0)
  69. Call ACOTable.SetMeasThresholdFontColor("UNITSLYPCT", trMiddle, 0 + 0 + 0)
  70. Call ACOTable.SetMeasThresholdFontColor("UNITSLYPCT", trLow, 0 + 0 + 0)
  71.  
  72. ' Rotate dimensions
  73. ' Move TIME to the ACROSS Edge next to MEASURE
  74. Call ACOTable.ChangeEdge("TIME", 1)
  75.  
  76. ' Select TIME & GEOGRAPHY
  77. Call ACOTable.SetSelection("TIME", 0, "Lmt TIME To T0.RangeOfMonth; Limit TIME keep Last 6")
  78. Call ACOTable.SetSelection("GEOGRAPHY", 1)
  79.  
  80. ACOTable.AutoRefresh = TRUE
  81.  
  82. Call MsgBox("Create two custom measures : " + _
  83.          Chr(10) + Chr(13) + _
  84.             "Units Last Year " + _
  85.          Chr(10) + Chr(13) + _
  86.         "Units Last Year % " + _
  87.          Chr(10) + Chr(13) + _
  88.             "and apply colour coding to them.", _
  89.     64, "ACOTable DemoScript 4")
  90.